const { classifyData } = require('../assets/classifyData')
const allServices = require('../db');

const insertClassify =  async () => {
  classifyData.forEach(fContent => {
    const fKey = fContent.name
    fContent.tags.forEach(sContent => {
      const sKey = sContent.name
      sContent.data.forEach(async item => {
        const singleData = [fKey, sKey || fKey, item.name]
        try {
          const res = await allServices.addClassify(singleData)
        } catch (error) {
          allServices.addErrorLog([error.sqlMessage, item.name])
        }
      })
    })
  })
}
module.exports = insertClassify

